<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
        <div id="app">
                账号:<input type="text" v-model="userinfo.username">
                密码:<input type="password" v-model="userinfo.password">
                    <button @click="login()">登录</button>
        </div>
</body>
<script src="./js/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
        const  app=new Vue({
            el:"#app",
            data:{
                userinfo:{
                    username:"",
                    password:""
                }
            },
            methods:{
                login(){
                    axios.post('http://localhost:8080/userinfo?method=login',this.userinfo)
                    .then(response=>{
                        console.log(response.data)//返回是否可以登录的凭证
                        //如果登录成功
                        location.href="success.html"
                    })
                }
            }
        })
</script>
</html>